'use strict';

(function () {

    app.service('dataService', ['$http', '$rootScope', function ($http, $rootScope) {
        this.appVo = new AppVO();

        /* F4 Help */
        this.getF4Help = function (iobjnm, vname, queryName) {
            var param = {
                iobjnm:iobjnm,
                vname:vname,
                queryName:queryName
            };
            return   $http({method:this.appVo.METHOD, url:this.appVo.BSP_GET_F4_URL, params:param});
        }

        this.getVarList = function (queryName) {
            var param = {
                rep_id:queryName
            };
            return  $http({method:this.appVo.METHOD, url:this.appVo.BSP_QUERY_VARS_LIST_URL, params:param});
        }


        this.executeQuery = function (param) {
            return $http({method:this.appVo.METHOD, url:this.appVo.BSP_QUERY_EXECUTE_URL, params:param});
        }

        this.getOrgTree = function (param) {
            var param = {};
            return $http({method:this.appVo.METHOD, url:this.appVo.BSP_ORG_TREE_URL});
        }

        this.exportToExcel = function (param) {
            return $http({method:this.appVo.METHOD, url:this.appVo.BSP_ORG_TREE_URL});
        }

        this.getComponentsList = function (param) {
            return $http({method:this.appVo.METHOD, url:this.appVo.COMPONENTS_LIST_URL});
        }
    }]);

}());